<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/pages/common/taglibs.jsp"%>


<div>
	<form action="${ctx}/setParam.do" method="post">
		<table width="100%" border=0>
			<tr>
				<td width="20%"></td>
				<td width="60%">设置测试地址</td>
				<td  width="45%"></td>
			</tr>
			<tr>
				<td width="20%"></td>
				<td width="60%"></td>
				<td  width="45%"></td>
			</tr>

			<c:forEach var="item" items="${urls}">
				<tr>
					<td width="20%" align=right>
						<input type='radio' name='key'	checked="checked" value='${item.key}' />
					</td>
					<td width="60%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${item.key} : ${item.value}</td>
					<td width="25%"></td>
				</tr>

			</c:forEach>
			<tr>
			<td width="20%"></td>
				<td  width="60%" align="right">
						<input style="width:70px"  type="submit" name="s" id="s" value="修改" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				</td>
				<td width="25%"></td>
			</tr>


		</table>
	</form>
</div>


<div style="margin-top: 20px">
<form name="paramSet" id="paramSet"
	action="${ctx}/setIndividualityParam.do" method="post">
	<table width="100%">
		<tr>
			<td width="30%"></td>
				<td width="45%"></td>
				<td width="25%"></td>
		</tr>
		<tr>
			<td width="30%" align=right>自定义测试地址 :</td>
				<td align=left width="45%">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="url" name="url" value=""
				size="50" /></td>
				<td width="25%"><span id="msg"></span></td>
		</tr>
		<tr>
				<td width="30%"></td>
				<td  width="45%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不填写,不会改变当前测试地址</td>
				<td width="25%"></td>
			</tr>
		<tr>
			<td width="30%" align=right >商户识别码设置:</td>
				<td align=left width="45%">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="key" name="key" value=""
				size="50" /></td><td width="25%"></td>
		</tr>
		<tr>
			<td width="30%"></td>
				<td width="45%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不填写,默认为11111aaaaa</td>
				<td width="25%"></td>
		</tr>
		<tr>
			<td width="30%" align=right >设置是否需要跳回到webtest:</td>
				<td align=left width="45%">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="isWebtestRedirect" name="isWebtestRedirect" value="true" checked="checked"
				size="50">是</input><input type="radio" id="isWebtestRedirect" name="isWebtestRedirect" value="false"
				size="50">否</input>
				</td>
			<td width="25%"></td>
		</tr>
		<tr>
			<td width="30%"></td>
				<td width="45%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不填写,默认为是</td>
				<td width="25%"></td>
		</tr>
		<tr>
			<td colspan="3" width="100%" height="1%"></td>
		</tr>
		<tr>
			<td width="30"></td>
				<td width="45%" align="right"><input style="width: 70px"
					type="submit" name="submit" id="submit" value="参数设置" /></td>
				<td width="25%"></td>
		</tr>
	</table>
</form>
</div>

<script type="text/javascript">
	$(document).ready(function() {
		$("#submit").click(function() {
			var val = $("#url").val();
			var flag = isURL(val);
			if (!flag) {
				$("#msg").text("url格式不正确");
			}
			return flag;
		});

	});

	function isURL(val) {
		if (val == "") {
			return true;
		}
		var strRegex = "((^http)|(^https)|(^ftp)):\/\/(\\w)+\.(\\w)+";
		var re = new RegExp(strRegex);
		if (re.test(val)) {
			return true;
		} else {
			return false;
		}
	}
</script>
